package net.fiodor.application {
	import flash.events.EventDispatcher;	
	
	import net.fiodor.log.Log;
	import net.fiodor.log.LogLevel;
	import net.fiodor.log.Logger;
	import net.fiodor.log.channel.FireBugChannel;
	import net.fiodor.log.channel.TraceChannel;
	
	import flash.display.DisplayObject;
	import flash.utils.getQualifiedClassName;		

	/**
	 * @author Tomasz Świerszcz
	 * tomasz.swierszcz@l4studio.pl
	 */
	public class Application extends EventDispatcher {

		private var __logger : Logger;

		public static var applicationContainer : DisplayObject;

		public function Application(appContainer : DisplayObject) {
			
			applicationContainer = appContainer;
			
			
		}
		
		public function getLogger() : Logger {
			
			if(!__logger) {
				__logger = Log.getLogger(getQualifiedClassName(this));
				__logger.addChannel(new TraceChannel());
				__logger.addChannel(new FireBugChannel());
				//__logger.addChannel(new FlashDebugChannel());
				__logger.setLogLevel(LogLevel.ALL);
			}
			return __logger;
		}
		
	}
}